USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_CREATE_TABLE]    Script Date: 11/24/2011 14:31:33 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0002_CREATE_TABLE]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0002_CREATE_TABLE]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_CREATE_TABLE]    Script Date: 11/24/2011 14:31:33 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[WASP_M0002_CREATE_TABLE]
AS
BEGIN
	IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[CSOPF000]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
	DROP TABLE [dbo].[CSOPF000]

	CREATE TABLE [dbo].[CSOPF000] (
		[CRAGENCIA] [int] NULL ,
		[CRCREDITO] [int] NULL ,
		[CRMARCA] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRRUTDEUDO] [decimal](8, 0) NULL ,
		[ RUTDEUDOR] [varchar](9) NULL,
		[CRTIPCLIE] [numeric](2, 0) NULL ,
		[CRDVEDEUDO] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRRUTCOD1] [decimal](8, 0) NULL ,
		[CRDVECOD1] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRRUTCOD2] [decimal](8, 0) NULL ,
		[CRDVECOD2] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRRUTEMPRE] [int ] NULL ,
		[CRDVEEMPRE] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRCLASE] [decimal](2, 0) NULL ,
		[CRCUOTAS] [decimal](2, 0) NULL ,
		[CRFECAPROB] [decimal](8, 0) NULL ,
		[CRVALCUOTA] [decimal](38,6) NULL ,
		[CRDIASPRIM] [decimal](3, 0) NULL ,
		[CRMONTO] [decimal](11, 2) NULL ,
		[CRORIGEN] [decimal](11, 2) NULL ,
		[CRSEGURO] [decimal](9, 2) NULL ,
		[CRTASA] [decimal](8, 4) NULL ,
		[CRESPECIAL] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRMODIFICA] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[STSMODREGC] [decimal](1, 0) NULL ,
		[FMODIFREGC] [decimal](8, 0) NULL ,
		[USRMODREGC] [char] (10) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRINDICA] [char] (2) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRSERIE] [decimal](4, 0) NULL ,
		[CRNOTARIO] [decimal](6, 0) NULL ,
		[CRIMPUESTO] [decimal](6, 0) NULL ,
		[CRCOMISION] [decimal](6, 0) NULL ,
		[CRFECUPAGO] [decimal](8, 0) NULL ,
		[USRMODAPRO] [char] (10) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRFECRELIQ] [decimal](8, 0) NULL ,
		[USRMODRELI] [char] (10) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRFECPRVEN] [decimal](8, 0) NULL ,
		[CRGASTOPER] [decimal](6, 0) NULL ,
		[CRMONABONA] [decimal](11, 2) NULL ,
		[CRESTADO] [char] (1) COLLATE Modern_Spanish_CI_AS NULL ,
		[CRSEGDESGR] [decimal](8, 0) NULL ,
		[CRSTSVGTE] [decimal](1, 0) NULL ,
		[CRSTSMORA] [decimal](1, 0) NULL ,
		[CRAGECOLOC] [int] NULL ,
		[FILLER] [char] (40) COLLATE Modern_Spanish_CI_AS NULL ,
		[ENDEUD_MAXIMO] [NUMERIC] (9,0),
		DISPONIBLE [decimal](9, 0) NULL ,
		COD_ANALISTA [char] (30),
		ANALISTA [char] (30),
		[ESTADOTRAB] [int],
		[CRMONTO_LIQ] [numeric](11) null,
		[cancelado] [varchar](2) null,
		[TIPO_CREDITO] [varchar](20) null,
		[Solicitante][int] null,
		[CTABANTOTAL] [numeric](9)null,
		[CRSEGCesantia] [numeric](9, 0) NULL ,
		[CRSegsalud] [numeric](9, 0) NULL         
	) ON [PRIMARY]

	COMMIT
END

GO


